<template>
	<view class="main">
		<code-elf-guide v-if="guidePages"></code-elf-guide>
	</view>
</template>

<script>
	import codeElfGuide from '@/components/code-elf-guide/code-elf-guide.vue'
	export default {
        components: {
            codeElfGuide
        },
		data() {
			return {
				guidePages:false //是否显示引导页
			}
		},
		onLoad(){
			this.loadExecution()
		},
		methods: {
			loadExecution: function(){
				/**
				 * 获取本地存储中.vuex_guide的值
				 * 若true，说明不是首次启动，直接进入首页；
				 * 若false，说明是首次启动，进入引导页；
				 */
				if (!this.vuex_guide) {
					 this.guidePages = true
				}else{
					// #ifdef APP-PLUS
					setTimeout(function(){
						uni.reLaunch({
							url: '/pages/index/index'
						});
					},120)
					// #endif
					// #ifndef APP-PLUS
					uni.reLaunch({
						url: '/pages/index/index'
					});		
					// #endif
				}
			}
		}
	}
</script>

<style>
	page,.main{
		width: 100%;
		height: 100%;
	}
</style>